#pragma once
#include <iostream>
#include "lib\Command.h"

namespace ConsoleHelper {

  enum EventType { key_return };

  void PutChar(char ch);
  
  void Put(std::string text);

  Command Prompt(const std::string prefix);

  template <class Type>
  std::istream& ReadStream(std::istream& is, Type& value) {
    std::string s;
    getline(is, s);
    if (is.good()) {
      std::stringstream ss(s);
      ss >> value;
      if (!ss.good()) {
        is.setstate(ss.rdstate());
      }
    }
    return is;
  }

}